@extends('model/admin')
@section('title','添加商品')
@section('content')
<!-- @if (count($errors) > 0)
    <div class="alert alert-danger">
        <ul>
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif -->
	@if (count($errors) > 0)
	<div class="mws-form-message error">
    	This is an error message
        <ul>
        	 @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
    @endif
	<div class="mws-panel grid_8">
    	<div class="mws-panel-header">
        	<span>添加商品</span>
        </div>
        <div class="mws-panel-body no-padding">
        	<form class="mws-form" action="/admin/goods/create" method='post' enctype='multipart/form-data'>
        		<div class="mws-form-inline">
        			<div class="mws-form-row">
        				<label class="mws-form-label">商品图片</label>
        				<div class="mws-form-item">
        					<input type="file" class="small" name='picname'>
        				</div>
        			</div>
        			<div class="mws-form-row">
        				<label class="mws-form-label">商品名</label>
        				<div class="mws-form-item">
        					<input type="text" class="small" name='goods'>
        				</div>
        			</div>
                    <div class="mws-form-row">
                        <label class="mws-form-label">品牌</label>
                        <div class="mws-form-item">
                            <select class="small" name='brand'>
                            @foreach($brand as $value)
                                <option value="{{$value['id']}}">{{$value['brand']}}</option>
                            @endforeach
                            </select>
                        </div>
                    </div>
                    <div class="mws-form-row">
                        <label class="mws-form-label">类别</label>
                        <div class="mws-form-item">
                            <select class="small" name='typeid'>
                            @foreach($type as $value)
                                <option value="{{$value['id']}}"  @if($value['pid']==0) disabled @endif>{{$value['name']}}</option>
                            @endforeach
                            </select>
                        </div>
                    </div>
        			<div class="mws-form-row">
        				<label class="mws-form-label">单价</label>
        				<div class="mws-form-item">
        					<input type="单价" class="small" name='price'>
        				</div>
        			</div>
        			<div class="mws-form-row">
        				<label class="mws-form-label">颜色</label>
        				<div class="mws-form-item">
        					<input type="text" class="small" name='color'>
        				</div>
        			</div>
                    <div class="mws-form-row">
                        <label class="mws-form-label">描述</label>
                        <div class="mws-form-item">
                            <textarea rows="" cols="" class="small" name='desc'></textarea>
                        </div>
                    </div>
        			<div class="mws-form-row">
        				<label class="mws-form-label">库存</label>
        				<div class="mws-form-item">
        					<input type="text" class="small" name='total'>
        				</div>
        			</div>
        			<div class="mws-form-row">
        				<label class="mws-form-label">尺寸</label>
        				<div class="mws-form-item clearfix">
        					<ul class="mws-form-list inline">
        						<li><input type="checkbox" name='size[]' value='S'> <label>S</label></li>
        						<li><input type="checkbox" name='size[]' value='M'> <label>m</label></li>
        						<li><input type="checkbox" name='size[]' value='L'> <label>L</label></li>
        						<li><input type="checkbox" name='size[]' value='XL'> <label>XL</label></li>
        						<li><input type="checkbox" name='size[]' value='XXL'> <label>XXL</label></li>
                                <li><input type="checkbox" name='size[]' value='XXXL'> <label>XXXL</label></li>
                                <li><input type="checkbox" name='size[]' value='37码'> <label>37码</label></li>
                                <li><input type="checkbox" name='size[]' value='38码'> <label>38码</label></li>
                                <li><input type="checkbox" name='size[]' value='39码'> <label>39码</label></li>
                                <li><input type="checkbox" name='size[]' value='40码'> <label>40码</label></li>
                                <li><input type="checkbox" name='size[]' value='41码'> <label>41码</label></li>
                                <li><input type="checkbox" name='size[]' value='42码'> <label>42码</label></li>
                                <li><input type="checkbox" name='size[]' value='43码'> <label>43码</label></li>
                                <li><input type="checkbox" name='size[]' value='44码'> <label>44码</label></li>
        					</ul>
        				</div>
        			</div>
                    <div class="mws-form-row">
                        <label class="mws-form-label">状态</label>
                        <div class="mws-form-item clearfix">
                            <ul class="mws-form-list inline">
                                <li><input type="radio" name='state' value='0'> <label>新添加</label></li>
                                <li><input type="radio" name='state' value='1'> <label>上架</label></li>
                                <li><input type="radio" name='state' value='2'> <label>限时特卖</label></li>
                                <li><input type="radio" name='state' value='3'> <label>下架</label></li>
                            </ul>
                        </div>
                    </div>
        		</div>
        		{{ csrf_field() }}
        		<div class="mws-button-row">
        			<input type="submit" value="确认添加" class="btn btn-danger">
        			<input type="reset" value="重新填写" class="btn ">
        		</div>
        	</form>
        </div>    	
    </div>
@endsection